package railRoad.io.files;
/*
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import railRoad.Route;
import railRoad.Schedule;
import railRoad.Station;

public final class CSVReader extends FileRead {

	@Override
	public void read() {
		Scanner in = this.getIn();
			
		Route route = null;
			
		Station station = null;
		String stationName = null, tmp;
		float atitude = 0, longitude = 0;
			
		Matcher matcher;
		String line;
			
		while ( in.hasNext() )
		{
			line = in.nextLine();
			matcher = Pattern.compile("Route;([0-9]*)|Station;([a-z]*[0-9]*);([0-9]*);([0-9]*)").matcher(line); 

			while(matcher.find())
			{
				//(Route;([0-9]*)) this is ([0-9]*)
				if ((tmp = matcher.group(1)) != null)
				route =  new Route(Integer.parseInt(tmp));
						
				//Station;([a-z]*[0-9]*);([0-9]*);([0-9]*)
				if ((tmp =  matcher.group(2)) != null)
					stationName = tmp;
				if ((tmp = matcher.group(3)) != null)
					atitude = Float.parseFloat(tmp);
				if ( (tmp = matcher.group(4)) != null)
					longitude = Float.parseFloat(tmp);
						
				if( stationName != null && atitude != 0 && longitude != 0 )
				{
					station = new Station(stationName, atitude, longitude);
					route.addStation(station);
				}//if
			}//while
					
			Schedule.getInstance().addRoute(route);
			stationName = null;
			atitude = 0;
			longitude = 0;
		}//while

		System.out.println("\n" + Schedule.getInstance().toString() );

	}//read()

}
*/